package cn.laixueit.service.impl;

import cn.laixueit.mapper.SpecGroupMapper;
import cn.laixueit.pojo.SpecGroup;
import cn.laixueit.service.SpecGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class SpecGroupServiceImpl extends ServiceImpl<SpecGroupMapper, SpecGroup> implements SpecGroupService {
    @Override
    public List<SpecGroup> groupsByCid(Long cid) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("cid",cid);
        List<SpecGroup> specGroupList = listByMap(map).stream().collect(Collectors.toList());
        return specGroupList;
    }
}
